﻿Imports Microsoft.Reporting.WinForms

Public Class frmInDSCuaHang
    Public _bs As BindingSource
    Public dsName As String
    Public rptName As String
    Public timkiemtheo As String = ""

    Private Sub frmInReport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ReportViewer1.LocalReport.ReportPath = rptName
        Dim ds As New ReportDataSource
        ds.Name = dsName
        ds.Value = _bs

        ReportViewer1.LocalReport.EnableExternalImages = True

        ReportViewer1.LocalReport.DataSources.Clear()
        ReportViewer1.LocalReport.DataSources.Add(ds)
        Dim lstpara As New ReportParameterCollection
        With lstpara
            .Add(New ReportParameter("TenBaoCao", Me.Text))
            .Add(New ReportParameter("TimKiemTheo", timkiemtheo))
            .Add(New ReportParameter("NgayIn", Now.ToString("dd/MM/yyyy HH:mm")))
            .Add(New ReportParameter("DuongDanAnh", "file:" + My.Settings.DuongDanAnh))
        End With
        ReportViewer1.LocalReport.SetParameters(lstpara)
        ReportViewer1.SetDisplayMode(DisplayMode.Normal)

        Me.ReportViewer1.RefreshReport()
    End Sub
End Class